/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
//		File Name		:		CBaseObject.h
//
//		Author			:		Vindicated Games
//
//		Purpose			:		A header for all functions and members of the Game Play State
//
//		Dates			:		Written( Feb 13, 2011 ) by Vindicated Games		LastUpdate( Feb 15, 2011  ) by Vindicated Games 
//	
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#ifndef BASEOBJECT_H_
#define BASEOBJECT_H_

#include "../SGD Wrappers/SGD_Math.h"
#include "../Core/IBaseInterface.h"
#include "../SGD Wrappers/CSGD_Direct3D.h"

//#include <vector>
//using std::vector;

// OBJ_POWERUP = Skill Augmenters, pickup upon collision
// OBJ_PICK = Small Pickup-able objects (Knives, crowbars )
// OBJ_PLATPICK = Pickup-able objects that are also platformable (Crates, barrels, etc)
enum Types{ OBJ_NULL, OBJ_PLAYER, OBJ_POWERUP, OBJ_PICK, OBJ_ENEMY, OBJ_PLATFORM, OBJ_ROCK, OBJ_HAND, OBJ_BUTTON, OBJ_MAX};

class CBaseObject : public IBaseInterface//, public IListener
{

private:

	Vector2D m_VecPosition;
	Vector2D m_VecVelocity;

	unsigned int m_uiRefCount;

	float m_nHP;
	int m_nWidth;
	int m_nHeight;
	int m_nType;
	bool landed;

	int m_nImageID;

	int heightFromGround;

	//Sounds
	//vector m_vSounds;

public:
	bool poisoned;

	D3DCOLOR color;
	//ctor and Destructor
	CBaseObject();
	virtual ~CBaseObject();

	////////////////////////////
	//Accessor and Modifiers  //
	////////////////////////////
	////////////////////////////
	//////////////////////////////////////////////////////
	float GetPosX()	{	return m_VecPosition.fX; }
	float GetPosY()	{	return m_VecPosition.fY; }

	float GetVelX()	{	return m_VecVelocity.GetX(); }
	float GetVelY()	{	return m_VecVelocity.GetY(); }

	float GetHP()			{	return m_nHP;		}
	int GetWidth()		{	return m_nWidth;	}
	int GetHeight()		{	return m_nHeight;	}
	int GetImageID()	{	return m_nImageID; }
	int GetType()		{	return m_nType;		}
	bool GetLanded()	{ return landed;}

	int GetGroundPt() {return heightFromGround;}
	////////////////////////////
	////////////////////////////
	//		Modifiers			 //
	////////////////////////////
	////////////////////////////////////////////////////////
	void SetPosY( float NewY )		{		m_VecPosition.fY = (NewY);	}
	void SetPosX( float NewX )		{		m_VecPosition.fX = (NewX);	}

	void SetVelX( float NewX )		{		m_VecVelocity.SetX(NewX);	}
	void SetVelY( float NewY )		{		m_VecVelocity.SetY(NewY);	}

	void SetHP(	   float NewHP  )	{		m_nHP = NewHP;				}
	void SetWidth( int NewWidth)	{		m_nWidth = NewWidth;		}
	void SetHeight( int NewHeight)	{		m_nHeight = NewHeight;		}
	void SetType(	int NewType)	{		m_nType = NewType;			}
	void SetImageID( int NewImage)	{		m_nImageID = NewImage;		}

	void SetLanded( bool Landed)	{		this->landed = Landed;		}
	void SetGroundPt(int point)		{		heightFromGround = point;	}
	////////////////////////////////////////////////////////

	virtual void Render();
	virtual bool Input();
	virtual void Update( float fElapsedTime);

	void AddRef(void)
	{
		m_uiRefCount++;
	}

	void Release(void)
	{
		m_uiRefCount--;

		if( m_uiRefCount == 0)
			delete this;
	}

	virtual RECT GetRect();
	virtual bool CheckCollision( IBaseInterface* pBase );

	void hurtcolor();
};
#endif